<%@page import="com.wef.demo.entity.domain.StudentDomain"%>
<%@page import="com.gfa4j.resource.ResourceManagerServer"%>
<%@page import="com.wef.common.util.CommonMessageDomain"%>
<%@page import="com.gfa4j.query.Field"%>
<%@ include file="/pages/common/taglib.jsp"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
		<title></title>
		<%@include file="/styles/css_lib.jsp"%>
		<%@include file="/scripts/widgets/jquery-ui/css_lib.jsp"%>
		<%@include file="/scripts/widgets/jqgrid/css_lib.jsp"%>
		
		<%@include file="/pages/common/js_global.jsp"%>
		<%@include file="/scripts/sdk/js_lib.jsp"%>
		<%@include file="/scripts/config/js_lib.jsp" %>
		<%@include file="/scripts/utils/js_lib.jsp"%>
		<%@include file="/scripts/i18n/js_lib.jsp"%>
		<%@include file="/scripts/format/js_lib.jsp"%>
		<%@include file="/scripts/validate/js_lib.jsp"%>
		<%@include file="/scripts/widgets/jquery-ui/js_lib.jsp"%>
		<%@include file="/scripts/widgets/jqgrid/js_lib.jsp"%>
		<%@include file="/scripts/widgets/autoSelect/js_lib.jsp"%>
		<%@include file="/scripts/widgets/datePicker/js_lib.jsp"%>
		<%@include file="/scripts/widgets/page-custom/js_lib.jsp"%>
		<script type="text/javascript" src="./demo_custom_action_col.js"></script>

		<k:jqgrid 
			queryObjectName="<%=StudentDomain.Student%>"
		 	jsonReader="{id:'studentId'}"
		 	colModel="[{name:'studentId',hidden:true},
		 		{actionType:'edit',name:'edit',actionUrl:'/pages/demo/single-table/demo_subject.jsp',tabId:'test1',tabTitle:'测试'},
		 		{actionType:'delete',name:'delete'},
		 		
		 		{actionType:'custom',width:80,label:'demo.Subject.actionImg.function',name:'custom1',actionImg:'/images/icon/add.gif',actionFunction:'actionFunction2',formatter:'customActionCol'},
		 		{actionType:'custom',width:80,label:'demo.Subject.actionImg.tab',name:'custom2',actionImg:'/images/icon/add.gif',actionUrl:'/pages/demo/single-table/demo_subject.jsp',tabTitle:'demo.Subject.actionImg.tab',tabId:'custom2',formatter:'customActionCol'},
		 		{actionType:'custom',width:80,label:'demo.Subject.actionImg.self',name:'custom3',actionImg:'/images/icon/add.gif',actionUrl:'/pages/demo/single-table/demo_subject.jsp',actionTarget:'self',formatter:'customActionCol'},
		 		
		 		{actionType:'custom',width:160,label:'demo.Subject.actionText.function',name:'custom4',actionText:'demo.Subject.actionText.function',actionFunction:'actionFunction1',formatter:'customActionCol'},
		 		{actionType:'custom',width:80,label:'demo.Subject.actionText.tab',name:'custom5',actionText:'demo.Subject.actionText.tab',actionUrl:'/pages/demo/single-table/demo_subject.jsp',tabTitle:'demo.Subject.actionText.tab',tabId:'custom5',formatter:'customActionCol'},
		 		{actionType:'custom',width:80,label:'demo.Subject.actionText.self',name:'custom6',actionText:'demo.Subject.actionText.self',actionUrl:'/pages/demo/single-table/demo_subject.jsp',actionTarget:'self',formatter:'customActionCol'},
		 		
		 		{label:'demo.Student.studentNum',name:'studentNum',formatter:'customActionLink',actionFunction:'actionFunction1'},
		 		{label:'demo.Student.studentName',name:'studentName',formatter:'customActionLink',actionUrl:'/pages/demo/single-table/demo_subject.jsp',actionTarget:'self'},
		 		{label:'demo.Student.birthday',name:'birthday',formatter:'date',formatoptions:{srcformat:'Y-m-d H:i:s',newformat:'Y-m-d'},originalDataType:'date'},
		 		{label:'demo.Student.gender',name:'gender',editable:true,edittype:'select',editoptions:'genderObj',formatter:'customValueText'},
		 		{label:'demo.Student.address',name:'address',formatter:'customActionLink',actionUrl:'/pages/demo/single-table/demo_subject.jsp',tabTitle:'customAction',tabId:'customAction_1'}
		 		]"		 		
			id="tableStudent"
			searchFormId="searchFormStudent"
			searchBtnId="searchBtnStudent"
		 	clearBtnId="clearBtnStudent"
		 	serviceMethodName="saveOrUpdateStudents"
		 	serviceName="StudentService"
		 	autowidth="false"
		 	/>
		
		<script type="text/javascript">
			//App.pageCustomEnable = true;App.pageId = "jqgrid";
			$(window).ready(function(){
				$('div[accordion=true]').accordion({collapsible : true});
				$('div[tabGroup=true]').tabs();
				$('#pageLoadComplete').attr('isComplete',true);
			});
		</script>
	</head>
<body class="body">

	<div id="divAccordion1" accordion="true">                             
		<h1><a href="#"><%=ResourceManagerServer.getInstance().getMessage(StudentDomain.StudentNLS)%>&nbsp;<%=ResourceManagerServer.getInstance().getMessage(CommonMessageDomain.TITLE_SERACH)%></a></h1>
		<div>
			<form id="searchFormStudent" name="searchFormStudent">
				<ul id="searchUlStudent" allowChange="true" class="search_box">
					<k:hidden property="studentId" styleId="searchStudentId"/>
					<li>
						<k:label text="demo.Student.studentNum" allowBlank="false"/>
						<k:text property="studentNum" styleId="searchStudentNum" styleClass="text" condition="likeaic"/>
					</li>
					<li>
						<k:label text="demo.Student.studentName" allowBlank="false"/>
						<k:text property="studentName" styleId="searchStudentName" styleClass="text" condition="likeaic"/>
					</li>
					<li>
						<k:label text="demo.Student.gender" allowBlank="false"/>
						<k:checkbox property="gender" styleId="searchGender" checked="false" value="true" formatRules="{checkedValueMap:{checked:true,unChecked:false}}" condition="eq"/>
						<!--
						<k:radio property="gender" styleId="searchGender1" text="男" value="true" condition="eq"/>
						<k:radio property="gender" styleId="searchGender2" text="女" value="false" condition="eq"/>
						-->
					</li>
					<li>
						<k:label text="demo.Student.idCard" allowBlank="false"/>
						<k:text property="idCard" styleId="searchIdCard" styleClass="text" condition="likeaic"/>
					</li>
					<li>
						<k:label text="demo.Student.birthday" allowBlank="false"/>
						<k:date property="birthday" styleId="searchBirthday" styleClass="text" condition="ge"/>
					</li>
					<li>
						<k:label text="demo.Student.birthday" allowBlank="false"/>
						<k:date property="birthday" styleId="searchBirthday" styleClass="text" condition="le"/>
					</li>
				</ul>
			</form>
		</div>
	</div>
	
	<div class="ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content-active">
		<ul class="button_box">
			<li>
				<k:button styleId="searchBtnStudent" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_SEARCH%>"/>
			</li>
			<li>
				<k:button styleId="clearBtnStudent" styleClass="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" text="<%=CommonMessageDomain.BUTTON_CLEAR%>"/>
			</li>
		</ul>
	</div>
	
	<div id="divAccordion2" accordion="true" style="width: 3000px;">
		<h1><a href="#"><%=ResourceManagerServer.getInstance().getMessage(StudentDomain.StudentNLS)%>&nbsp;<%=ResourceManagerServer.getInstance().getMessage(CommonMessageDomain.TITLE_TABLE)%></a></h1>
		<div>
			<table id="tableStudent"></table>
		</div>
	</div>
	<div id="pageLoadComplete" isComplete="false" style="display: none;"></div>
</body>
</html>